<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>父容器设置 ​​overflow: hidden​​​ + ​​border-radius​</title>
</head>
<link rel="stylesheet" href="../../common.css">
<style>
    :root {
        --bg: #222;
    }

    .box {
        position: relative;
        width: 200px;
        height: 200px;
        border-radius: 50%;
        overflow: hidden;
        /* 不适合圆 */
    }

    .box::before {
        content: "";
        position: absolute;
        width: 200px;
        height: 200px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        border: 10px solid;
        border-image: linear-gradient(45deg, gold, deeppink) 1;
    }

    .border-image-overflow2 {
        position: relative;
        width: 200px;
        height: 100px;
        border-radius: 10px;
        overflow: hidden;
    }

    .border-image-overflow2::after {
        content: "";
        position: absolute;
        width: 200px;
        height: 100px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        border: 10px solid;
        border-image: linear-gradient(45deg, gold, deeppink) 1;
    }
</style>

<body>
    <section>
        <div class="box" style="margin-bottom:50px"></div>
        <div class="border-image-overflow2"></div>
    </section>

</body>

</html>